﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Surcharges.aspx.cs" Inherits="IFD2.Surcharges" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <link href="Datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>

    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>--%>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label4" runat="server" Text="Status：" meta:resourcekey="Status"></asp:Label>
                <asp:DropDownList ID="lstStatus" runat="server" CssClass="form-control input-sm" style="width:100%">
                    <asp:ListItem Value="E" meta:resourcekey="Editing">Editing</asp:ListItem>
                    <asp:ListItem Value="S" meta:resourcekey="Submitted">Submitted</asp:ListItem>
                    <asp:ListItem Selected="True" Value="A" meta:resourcekey="Approved">Approved</asp:ListItem>
                    <asp:ListItem Value="X" meta:resourcekey="Cancelled">Cancelled</asp:ListItem>
                </asp:DropDownList>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="airline,code" DataSourceID="SqlDataSource1" class="table-hover" style="min-width:800px;width:100%;" CellPadding="4" ForeColor="#333333" GridLines="None">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                    <input name="KEY" type="radio" value='<%# Eval("code")+"|"+Eval("effective_time")+"|"+Eval("flt_surcharge_types") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="code" HeaderText="code" ReadOnly="True" SortExpression="code" meta:resourcekey="code1" />
                                <asp:BoundField DataField="flt_surcharge_types" HeaderText="flt_surcharge_types" ReadOnly="True" SortExpression="flt_surcharge_types" meta:resourcekey="flt_surcharge_types" />
                                <asp:BoundField DataField="effective_time" HeaderText="effective_time" ReadOnly="True" SortExpression="effective_time" meta:resourcekey="effective_time" />
                                <asp:BoundField DataField="name" HeaderText="name" ReadOnly="True" SortExpression="name" meta:resourcekey="name1" />
                                <asp:BoundField DataField="type" HeaderText="type" SortExpression="type" meta:resourcekey="type1" />
                                <asp:BoundField DataField="currency" HeaderText="currency" ReadOnly="True" SortExpression="currency" meta:resourcekey="currency1" />
                                <asp:BoundField DataField="adt_price" HeaderText="adt_price" ReadOnly="True" SortExpression="adt_price" meta:resourcekey="adt_price" />
                                <asp:BoundField DataField="chd_price" HeaderText="chd_price" ReadOnly="True" SortExpression="chd_price" meta:resourcekey="chd_price" />
                                <asp:BoundField DataField="inf_price" HeaderText="inf_price" ReadOnly="True" SortExpression="inf_price" meta:resourcekey="inf_price" />
                                <asp:BoundField DataField="note" HeaderText="note" SortExpression="note" meta:resourcekey="note1" />
                                <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user" meta:resourcekey="done_user1" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time" meta:resourcekey="done_time1" />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                    </div>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" SelectCommand="bll_surcharge_get_by_status" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lstStatus" Name="status" PropertyName="SelectedValue" Type="String" />
                            <asp:SessionParameter Name="lang" SessionField="LANG" Type="Byte" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <div class="btn-group">
                        <asp:Button ID="btnNames" runat="server" CssClass="btn btn-sm btn-default" Text="Names..."  meta:resourcekey="Names" OnClick="btnNames_Click" />
                        <asp:Button ID="btnSegments" runat="server" CssClass="btn btn-sm btn-default" Text="Segments..."  meta:resourcekey="Segments" OnClick="btnSegments_Click" />
                        <asp:Button ID="btnLog" runat="server" CssClass="btn btn-sm btn-default" Text="Log..." meta:resourcekey="Log" OnClick="btnLog_Click" />
                    </div>
                    <div class="btn-group">
                        <asp:Button ID="btnSubmit" runat="server" CssClass="btn btn-sm btn-default" Text="Submit" meta:resourcekey="Submit" OnClick="btnSubmit_Click" />
                        <asp:Button ID="btnDelete" runat="server" CssClass="btn btn-sm btn-default" Text="Delete" OnClick="btnDelete_Click"  meta:resourcekey="Delete" />
                    </div>
                    <div class="btn-group">
                        <asp:Button ID="btnApprove" runat="server" CssClass="btn btn-sm btn-default" Text="Approve" meta:resourcekey="Approve" OnClick="btnApprove_Click" />
                        <asp:Button ID="btnReject" runat="server" CssClass="btn btn-sm btn-default" Text="Reject" meta:resourcekey="Reject" OnClick="btnReject_Click" />
                        <asp:Button ID="btnCancel" runat="server" CssClass="btn btn-sm btn-default" Text="Cancel" meta:resourcekey="Cancel" OnClick="btnCancel_Click" />
                    </div>
                    <br />
                    
                    <div class="well well-sm">
                        <div class="form-group">
                            <asp:Label ID="Label1" runat="server" Text="Code：" meta:resourcekey="Code"></asp:Label>
                            <asp:TextBox ID="txtCode" runat="server" MaxLength="10" Width="100px"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <asp:Label ID="Label10" runat="server" Text="Effictive Time:" meta:resourcekey="EffectiveTime"></asp:Label>
                            <asp:TextBox ID="txtEffectiveTime" CssClass="form_datetime" runat="server"  Width="120px" MaxLength="16"></asp:TextBox>
                        </div>
                        <br class="hidden-xs"/>
                        <div class="form-group">
                            <asp:Label ID="Label3" runat="server" Text="Charge Type:" meta:resourcekey="Type"></asp:Label>
                            <asp:DropDownList ID="lstTypes" runat="server">
                                <asp:ListItem Selected="True" Value="T" meta:resourcekey="Tax">Tax</asp:ListItem>
                                <asp:ListItem Value="S" meta:resourcekey="Surcharge">Surcharge</asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <div class="form-group">
                            <asp:Label ID="Label9" runat="server" Text="Flt. Charge Types:" meta:resourcekey="FltChargeTypes"></asp:Label>
                            <asp:TextBox ID="txtFltChargeTypes" runat="server" Text="0123456789" MaxLength="10"></asp:TextBox>
                        </div>
                        <br class="hidden-xs"/>
                        <div class="form-group">
                            <asp:Label ID="Label5" runat="server" Text="Currency:" meta:resourcekey="Currency"></asp:Label>
                            <asp:DropDownList ID="lstCurrencies" runat="server" DataSourceID="sqlCurrencies" DataTextField="code" DataValueField="code"></asp:DropDownList>
                        </div>
                        <div class="form-group">
                            <asp:Label ID="Label6" runat="server" Text="Adt. Price:" meta:resourcekey="AdtPrice"></asp:Label>
                            <asp:TextBox ID="txtAdtPrice" runat="server"  Width="70px" MaxLength="8"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <asp:Label ID="Label7" runat="server" Text="Chd. Price:" meta:resourcekey="ChdPrice"></asp:Label>
                            <asp:TextBox ID="txtChdPrice" runat="server"  Width="70px" MaxLength="8"></asp:TextBox>
                        </div>
                        <div class="form-group">
                            <asp:Label ID="Label8" runat="server" Text="Inf. Price:" meta:resourcekey="InfPrice"></asp:Label>
                            <asp:TextBox ID="txtInfPrice" runat="server"  Width="70px" MaxLength="8"></asp:TextBox>
                        </div>
                        <br class="hidden-xs"/>
                        <div class="form-group">
                            <asp:Label ID="Label2" runat="server" Text="Note：" meta:resourcekey="Note"></asp:Label>
                            <asp:TextBox ID="txtNote" runat="server" MaxLength="100" Width="300px"></asp:TextBox>
                        </div>
                        <br class="hidden-xs" /><br class="hidden-xs" />
                        <asp:Button ID="btnAdd" runat="server" Text=" Add " CssClass="btn btn-sm btn-default" meta:resourcekey="Add" OnClick="btnAdd_Click" />
                        
                        <asp:SqlDataSource ID="sqlCurrencies" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" SelectCommand="bll_currency_get_codes" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                    </div>
                </div>
            </div>

        </div>
    </div>

    </div>
    <%--</ContentTemplate></asp:UpdatePanel>--%>
    </form>
    
    <script src="Datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script>
        $(document).ready(function () {
            $('.form_datetime').datetimepicker({
                format: 'yyyy-m-d hh:ii',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 'month',
                forceParse: 0,
                showMeridian: 0
            });
        });
  	</script>
</asp:Content>
